<?php 
	$objConver  			= new HT_Model_administrator_models_convert();
	$objUtil  				= new HT_Model_administrator_models_utility();
	$trainingNews 			= $this->trainingNews;
	
	$seoNews 				= $trainingNews['seoNews'];
	$phpNews 				= $trainingNews['phpNews'];
	$trainingNews 			= $trainingNews['trainingNews'];
?>
<div class="column1 fl">
	<div class="c1_box1_1">
		<div class="hot_news fl">
			<div class="training_image"><img title="" alt="" src="<?php echo WEB_PATH;?>/public/images/dao-tao-lap-trinh-vien-php-giang-vien-7-nam-kinh-nghiem-tai-cac-tap-doan-da-quoc-gia-0936807207.png" /></div>
			<form id="frmRequest" name="frmRequest" method="post">
			<input type="hidden" id="requestUrl" value="<?php echo WEB_PATH;?>/front/elements/phprequest/">
			<div class="seo_service">
				<div class="seosv_line"><span>Đăng ký học lập trình web</span></div>
				<div class="seosv_line"><textarea id="request_content" name="request_content"></textarea></div>
				<div class="seosv_line">Họ tên, Điện Thoại, Email, Thông tin khác...</div>
				<div class="cb"></div>
				<div id="requestBtn" class="seosv_button fr">Đăng ký học</div>
				<div id="loading" class="loading mt15 mr5 fr"></div>
				<div class="cb"></div>
			</div>
			</form>
		</div>
		<div class="hot_news_list fl">
			<div class="hot_news_list_header">Đào tạo PHP - SEO - SEM - Social Marketing</div>
			<?php 
				for($i=0;$i<4;$i++){
					$news 				= @$trainingNews[$i];
					$newsTitle 			= stripcslashes($news['title']);
					$newsPath 			= ROOT_PATH."/public/uploads/news/".$news['image'];
					$newsImageUrl		= null;
					if(is_file($newsPath)){
						$newsImageUrl	= WEB_PATH."/public/uploads/news/".$news['image'];
					}
					$newsDescription 	= $objUtil->tooltipString(trim(stripcslashes($news['description'])),100);
					$newsUrl			= WEB_PATH.'/chi-tiet/'.$objConver->utf8_to_url($newsTitle).'-'.$news['news_id'].'.html';
			?>
			<div class="hot_item">
				<?php if($newsImageUrl){?>
				<div class="hot_item_image fl"><img src="<?php echo $newsImageUrl;?>"></div>
				<?php }?>
				<a alt="<?php echo $newsTitle;?>" title="<?php echo $newsTitle;?>" href="<?php echo $newsUrl;?>"><?php echo $newsTitle;?></a>
				<br>
				<?php echo $newsDescription;?>
			</div>
			<div class="cb"></div>
			<?php }?>
		</div>
		<div class="cb"></div>
	</div>
	<!-- div class="c1_box2">
		<?php 
			for($i=4;$i<8;$i++){
				$news 				= @$seoNews[$i];
				$newsTitle 			= stripcslashes($news['title']);
				$newsPath 			= ROOT_PATH."/public/uploads/news/".$news['image'];
				$newsImageUrl		= null;
				if(is_file($newsPath)){
					$newsImageUrl	= WEB_PATH."/public/uploads/news/".$news['image'];
				}
				$newsDescription 	= $objUtil->tooltipString(trim(stripcslashes($news['description'])),100);
				$newsUrl			= WEB_PATH.'/chi-tiet/'.$objConver->utf8_to_url($newsTitle).'-'.$news['news_id'].'.html';
		?>
		<div class="cb2_item fl">
			<?php if($newsImageUrl){?>
			<div class="cb2_image"><img src="<?php echo $newsImageUrl;?>"></div>
			<?php }?>
			<div class="cb2_title"><a alt="<?php echo $newsTitle;?>" title="<?php echo $newsTitle;?>" href="<?php echo $newsUrl;?>"><?php echo $newsTitle;?></a></div>
		</div>
		<?php }?>
		<div class="cb"></div>
	</div -->
	<div class="c1_box3">
		<div class="yb_header">
			<div class="ybh_1 fl"></div>
			<div class="ybh_subject fl"><a href="<?php echo WEB_PATH;?>/chuyen-muc/hoc-lap-trinh-php-html-css-javascript-jquery-online-3.html">Học PHP online</a></div>
			<div class="ybh_3 fl"></div>
			<div class="ybh_item fl"></div>
			<div class="cb"></div>
		</div>
		<?php 
			$totalNews = sizeof($phpNews);
			for($i=0;$i< $totalNews; $i++){
				$news 				= $phpNews[$i];
				$newsTitle 			= stripcslashes($news['title']);
				$newsPath 			= ROOT_PATH."/public/uploads/news/".$news['image'];
				$newsImageUrl		= null;
				if(is_file($newsPath)){
					$newsImageUrl	= WEB_PATH."/public/uploads/news/".$news['image'];
				}
				$newsDescription 	= $objUtil->tooltipString(trim(stripcslashes($news['description'])),100);
				$newsUrl			= WEB_PATH.'/chi-tiet/'.$objConver->utf8_to_url($newsTitle).'-'.$news['news_id'].'.html';
				if($i %2 == 0){
					$newsBox = 'news_box1';
				}else{
					$newsBox = 'news_box2';
				}
				
		?>
		<div class="<?php echo $newsBox;?> fl">
			<div class="news_title"><a alt="<?php echo $newsTitle;?>" title="<?php echo $newsTitle;?>" href="<?php echo $newsUrl;?>"><?php echo $newsTitle;?></a></div>
			<div class="news_info">
				<?php if($newsImageUrl){?>
				<div class="news_image1 fl"><img alt="" src="<?php echo $newsImageUrl;?>"></div>
				<?php }?>
				<?php echo $newsDescription;?>
				<div class="cb"></div>
			</div>
		</div>
		<?php 
				if($i %2 == 1 && $i != $totalNews - 1){
					echo '<div class="cb"></div><div class="news_line"></div>';
				}elseif($i %2 == 1){
					echo '<div class="cb"></div>';
				}elseif($totalNews %2 == 1 && $i == $totalNews - 1){
					echo '<div class="cb"></div>';
				}
			}
		?>
		<div class="bb_line"></div>
		<div class="bb_header">
			<div class="bbh_1 fl"></div>
			<div class="bbh_subject fl"><a href="<?php echo WEB_PATH;?>/chuyen-muc/hoc-lam-seo-sem-social-networking-4.html">Học SEO online</a></div>
			<div class="bbh_3 fl"></div>
			<div class="bbh_item fl"></div>
			<div class="cb"></div>
		</div>
		<?php 
			$totalNews = sizeof($seoNews);
			for($i=0;$i< $totalNews; $i++){
				$news 				= $seoNews[$i];
				$newsTitle 			= stripcslashes($news['title']);
				$newsPath 			= ROOT_PATH."/public/uploads/news/".$news['image'];
				$newsImageUrl		= null;
				if(is_file($newsPath)){
					$newsImageUrl	= WEB_PATH."/public/uploads/news/".$news['image'];
				}
				$newsDescription 	= $objUtil->tooltipString(trim(stripcslashes($news['description'])),100);
				$newsUrl			= WEB_PATH.'/chi-tiet/'.$objConver->utf8_to_url($newsTitle).'-'.$news['news_id'].'.html';
				if($i %2 == 0){
					$newsBox = 'news_box1';
				}else{
					$newsBox = 'news_box2';
				}
				
		?>
		<div class="<?php echo $newsBox;?> fl">
			<div class="news_title"><a alt="<?php echo $newsTitle;?>" title="<?php echo $newsTitle;?>" href="<?php echo $newsUrl;?>"><?php echo $newsTitle;?></a></div>
			<div class="news_info">
				<?php if($newsImageUrl){?>
				<div class="news_image1 fl"><img alt="" src="<?php echo $newsImageUrl;?>"></div>
				<?php }?>
				<?php echo $newsDescription;?>
				<div class="cb"></div>
			</div>
		</div>
		<?php 
				if($i %2 == 1 && $i != $totalNews - 1){
					echo '<div class="cb"></div><div class="news_line"></div>';
				}elseif($i %2 == 1){
					echo '<div class="cb"></div>';
				}elseif($totalNews %2 == 1 && $i == $totalNews - 1){
					echo '<div class="cb"></div>';
				}
			}
		?>
		
	</div>
	<div class="cb"></div>
</div>
<div class="column2 fl">
	<?php echo $this->action('rightadv3','elements','front');?>
	<?php echo $this->action('rightadv5','elements','front');?>
</div>
<div class="cb"></div>

<script type="text/javascript">
	$(document).ready(function(){
		$('#requestBtn').click(function(){
			if($('#request_content').val() == ''){
				alert("Vui lòng nhập thông tin để chúng tôi có thể liên hệ với bạn về khóa học.");
				$('#request_content').focus();
				return;
			}else{
				$('#loading').show();
				$.ajax({
			        url: $("#requestUrl").val(),
			        cache: false,
			        type: "POST",
			        data: $('#frmRequest').serialize(),           
			        success: function(serverData){
			        	$('#loading').hide();
			        	alert("Cảm ơn bạn đã đăng ký học tại goodgood.vn. Chúng tôi sẽ liên hệ với bạn trong thời gian sớm nhất!");
			        	$('#request_content').val('');
			        }
			      });
			}
		});
	});
</script>